<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {

    Route::get('/','User\LoginController@login');
    Route::post('/login/do_login','User\LoginController@do_login');
    Route::get('/logout','User\LoginController@logout');

    Route::group(['middleware' => ['CheckToken']], function () {
            Route::get('/index', 'Index\IndexController@index');
            Route::any('/summary', 'Index\IndexController@summary');
            Route::get('/userList', 'Index\IndexController@userList');
            Route::get('/openUser', 'Index\IndexController@openUser');
            Route::post('/doOpenUser', 'Index\IndexController@doOpenUser');
            Route::post('/doOpenUser', 'Index\IndexController@doOpenUser');
            Route::get('/renewvip', 'Index\IndexController@renewvip');         //  续费
            Route::post('/doRenew', 'Index\IndexController@doRenew');         //  续费
            Route::get('/discount', 'Index\IndexController@discount');         //  续费


    });


});
